package com.ivan.dao;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.ivan.beans.ChatUser;

public class ChatUserDao {

	/**
	 * Get all availbe Users from database.
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<ChatUser> getAvailableUsers(){
		List<ChatUser> users = new ArrayList<ChatUser>();
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Query query = pm.newQuery(ChatUser.class);
		users = (List<ChatUser>) query.execute();
		return users;
	}
	
}
